package com.kitri.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.kitri.dao.AppContext;
import com.kitri.dao.BoardDao;
import com.kitri.dao.BoardDaoImpl;
import com.kitri.domain.Board;


@Service
public class BoardServiceImpl implements BoardService {
	private BoardDao boardDao = null;

	public BoardServiceImpl() {
			this.boardDao = ((BoardDaoImpl)AppContext.getAppContext().getBean("boardDao"));
	}

	@Override
	public boolean add(Board board) {
		return boardDao.insert(board);
	}

	@Override
	public void update(Board board) {
		boardDao.update(board);
	}

	@Override
	public boolean remove(int boardSeq) {
		return boardDao.delete(boardSeq);
	}

	@Override
	public Board select(int boardSeq) {
		return boardDao.select(boardSeq);
	}

	@Override
	public List<Board> selectAll(int type) {
		return boardDao.selectAll(type);
	}
}
